{% extends "layout.html" %}

{% block header -%}
{{ super() }}
<hr/>
<script>
  /**
   * Pseudo namespace for chromium - keep it short because we are in a very
   * narrow scope for this file.
   * @type {Object}
   */
  var c = {};

  /**
   * Replaces html references with anchor tags to the same.
   * @param {String} className CSS class to operate on.
   */
  function autoLink(className) {
    var comments = document.querySelectorAll(className);
    for(var i = 0; i < comments.length; i++) {
      comments[i].innerHTML = comments[i].innerHTML.replace(
          /https?:\/\/[^ \t\n<]*/g, '<a href="$&">$&</a>');
    }
  };

  window.addEventListener("load", function() {
    autoLink('.DevComment');
  }, false);

  /**
   * This is the indicator for whether we are in console or waterfall
   * mode, or some future resource.
   * @type {String}
   */
  c.viewtype = location.pathname.split('/').slice(-1);

  /**
   * Returns a search string portion including marker, or an empty string.
   * optional.
   * @param {String} opt_s A search string, or some form of emptiness.
   * @returns {!String}
   */
  function search(opt_s) {
    return opt_s ? '?' + opt_s.replace(/^[?]/, '') : '';
  };

  /**
   * Replicates a string.
   * @param {Number} i A whole number of repetitions.
   * @param {String} x The string to be repeated.
   * @returns {!String}
   */
  function repeat(i, x){
    var t = ''
    for (j = 0; j < i; j++) { t += x; }
    return t;
  };

  /**
   * A simple HTML table string.
   * @param {String} attributes A set of HTML attributes for the table.
   * @param {String} contents The contents.
   * @returns {!String}
   */
  function table(attributes, contents) {
      return '<table ' + attributes + '>' + contents + '</table>\n';
  };

  /**
   * A simple HTML div string.
   * @param {String} attributes A set of HTML attributes for the div.
   * @param {String} contents The contents.
   * @returns {!String}
   */
  function div(attributes, contents) {
    return '<div ' + attributes + '>' + contents + '</div>';
  };

  /**
   * A simple HTML table row string.
   * @param {String} attributes A set of HTML attributes for the table row.
   * @param {String} contents The contents.
   * @returns {!String}
   */
  function tr(contents) {
    return '<tr>' + contents + '</tr>\n';
  };

  /**
   * A simple HTML table cell string.
   * @param {String} attributes A set of HTML attributes for the table cell.
   * @param {String} contents The contents.
   * @returns {!String}
   */
  function td(attributes, contents) {
    return '<td ' + attributes + '>' + contents + '</td>';
  };

  /**
   * A simple HTML anchor string.
   * @param {String} url The value for the href.
   * @param {String} attributes A set of HTML attributes for the table.
   * @param {String} contents The contents.
   * @returns {!String}
   */
  function a(url, contents, attributes) {
    return '<a href="' + url + '" ' + attributes + '>' + contents + '</a>';
  };

  /**
   * Gives an HTML anchor string to the specified URL, but of the same view
   * type as the current page.
   * @param {String} url The URL portion up to the view.
   * @param {String} search_opt A the query portion.
   * @param {String} contents The contents for the tag.
   * @returns {!String}
   */
  function aView(url, search_opt, contents) {
      return a((url ? url + '/' : '') + c.viewtype + search(search_opt),
               contents, '')
  };

  /**
   * A simple HTML iframe string.
   * @param {String} attributes A set of HTML attributes for the table.
   * @param {String} url The source of the iframe.
   * @returns {!String} the iframe or an empty string if noframe is specified.
   */
  function iFrame(attributes, url) {
      if (window.location.href.search('noframe') == -1) {
          return '<iframe ' + attributes + ' src="' + url + '"></iframe>';
      }
      return ''
  };
</script>

<div class="Announcement">

<iframe width="100%" height="44" frameborder="0" scrolling="no" src="https://chromiumos-status.appspot.com/current"></iframe>

<center style="padding: 0 7px">
  <table width="100%" valign="top" bgcolor="#efefef" style="-webkit-border-bottom-left-radius: 24px; -webkit-border-bottom-right-radius: 24px; -moz-border-bottom-right-radius: 24px; -moz-border-bottom-right-radius: 24px;   box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6); -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6); -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);">
    <tr>
      <td width="29%">
        <table valign="top" width="100%">
          <tr>
            <td style="text-align: right;">
              <b>Builds:</b>
            </td>
            <td>
              <a href="https://chromiumos-status.appspot.com">status</a>
              <a href="one_line_per_build">manage all</a>
            </td>
          </tr>
          <tr>
            <td style="text-align: right;">
              <b>ChromiumOS:</b>
            </td>
            <td>
              <a href="https://chromium.googlesource.com">sources</a> |
              <a href="https://chromium-review.googlesource.com">reviews</a> |
              <a href="https://code.google.com/p/chromium-os/issues/list">bugs</a> |
              <a href="http://dev.chromium.org/chromium-os">dev</a>
            </td>
          </tr>
          <tr>
            <td style="text-align: right;">
               <b>Sheriffs:</b>
            </td>
            <td>
              <script src='./sheriff.js'></script>,
              <script src='./sheriff2.js'></script>
            </td>
          </tr>
          <tr>
            <td style="text-align: right;">
               <a href="https://goto.google.com/cros-build-deputy"><b>Build Deputy:</b></a>
            </td>
            <td>
              <!-- Add a link to the rotation. TODO(dnj): Replace this with rotation embedding. -->
              <a href="https://rotation.googleplex.com/index.html#rotation?id=5660790132572160">Rotation</a>
            </td>
          </tr>
          <tr>
            <td style="text-align: right;">
               <b>Gardeners:</b>
            </td>
            <td>
              <script src='./sheriff_cr_cros_gardeners.js'></script>
              (<a href="http://dev.chromium.org/developers/tree-sheriffs/chrome-in-chromeos-gardening">Chrome</a>)
            </td>
          </tr>
          <tr>
            <td style="text-align: right;">
               <b>Navigate:</b>
            </td>
            <td colspan="2">
              <a href="http://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot">about</a> |
              <a href="./waterfall/help">customize</a> |
              <a href="./waterfall">waterfall</a> |
              <a href="./waterfall?show_events=true&failures_only=true">failures</a> |
              <a href="./console">console</a> |
            </td>
          </tr>
        </table>
      </td>
      <td width="1" bgcolor="#CCCCCC">
      </td>
      <td width="2%">
      </td>
      <td width="72%">
        <table width="100%">
          <script src='./auto-builder.js'></script>,
          <script language="javascript">
            var chromiumos_chromium = [
                "builder=X86+(chromium)",
                "builder=AMD64+(chromium)",
                "builder=Daisy+(chromium)",
                "titles=on",
            ].join("&");

            var bar = "https://build.chromium.org/p/chromiumos/horizontal_one_box_per_builder"
            var bar_chromiumos_chromium = "https://build.chromium.org/p/chromiumos.chromium/horizontal_one_box_per_builder"

            var waterfall = '../chromiumos/waterfall'
            var waterfall_chromiumos_chromium = '../chromiumos.chromium/waterfall'
            var waterfall_memory = "../chromium.memory/waterfall"

            function GetUrl(type, content) {
              return type + "?" + content;
            }

            function DisplayBar(waterfall_url, bar_url, content, name) {
              document.write("<tr><td><a href='" + GetUrl(waterfall_url, content) + "'>" + name + "</a></td><td width='99%'><iframe width='100%' height='20' frameborder='0' scrolling='no' src='" + GetUrl(bar_url, content) + "'></iframe></td></tr>\n");
            }

            function AddBuilderSetBar(builders, name) {
              var link = builders.map(function(e) {
                  return "builder=" + e;
              }).join("&") + "&titles=off"
              DisplayBar(waterfall, bar, link, name);
            }

            AddBuilderSetBar(buildercfg["closers"], "Closers");
            AddBuilderSetBar(buildercfg["full"], "Full");
            AddBuilderSetBar(buildercfg["incremental"], "Incremental");
            AddBuilderSetBar(buildercfg["asan"], "ASAN");
            AddBuilderSetBar(buildercfg["paladin"], "Commit Queue");
            DisplayBar(waterfall_chromiumos_chromium, bar_chromiumos_chromium,
                chromiumos_chromium, "chromiumos.chromium")
          </script>
        </table>
      </td>
      <td width="3%">
      </td>
    </tr>
  </table>
</center>

</div>
{% endblock header %}

{% block footer %}

{{ super() }}
{# <p>Debug info: {{ debuginfo }}</p> #}
{% endblock %}
